<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
    function change() {
        var pid=jQuery("#first option:selected").val();
        jQuery(" #second").remove();
        $.getJSON("/goodsUpload/classification","pid="+pid,callback)
        function callback(data) {
            jQuery("#pp").append("<select id=\"second\" name='classificationid' ></select>")
          for (var a=0;a<data.length;a++){
              var id=data[a].classificationid;
              var name=data[a].descriptionofspecies;
               jQuery("#second").append("<option name='classificationid' class=\"select2\"value="+id+">"+name+"<option>")
          }
        }
    }
    


</script>
<body>
<form   action="/goodsUpload/goods"  method="post" enctype="multipart/form-data">
    <p>商品名称：<input type="text" name="tradename"></p>
    <p>价格 &nbsp &nbsp &nbsp &nbsp ：<input type="text" name="price"></p>
    <p>折扣 &nbsp &nbsp &nbsp &nbsp ：<input type="text" name="membershipdiscount"></p>
    <p>商品说明：<input type="text" name="commoditydescription"></p>
    <p>商品亮点：<input type="text" name="commodityhighlights"></p>
    <p>商品规格：<input type="text" name="specifications"></p>
    <p>商品保质期：<input type="text" name="qualityguaranteeperiod"></p>
    <p>储存方式：<input type="text" name="storagemode"></p>
    <p>包装 &nbsp &nbsp &nbsp &nbsp：<input type="text" name="baozhuang"></p>
    <p>商品一级分类：<select id="first" onchange="change()">
        <option th:each="list : ${map.get('fristClassify')}" th:text="${list.getDescriptionofspecies()}" th:value="${list.getClassificationid()}"></option>
    </select></p>
    <p id="pp">商品二级分类:<select id="second" name="classificationid">
        <option class="select2"  th:each="list1 : ${map.get('secondClassify')}" th:text="${list1.getDescriptionofspecies()}" th:value="${list1.getClassificationid()}"></option>
    </select></p>
    <p>商品主展示图：<input type="file" name="file1"><p>
    <p>商品其它展示图：<input type="file" name="file2" multiple="multiple"><p>
    <p>商品详情图：<input type="file" name="file3" multiple="multiple" ><p>
    <p><input type="submit" ></p>
</form>
</body>
</html>